import java.util.ArrayList;
import java.util.List;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.junit.Test;

import com.test.cxf.domain.User;
import com.test.cxf.service.HelloService;

public class Client {

	/**
	 * @param args
	 */
	@Test
	public void testmain() {
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		factory.setServiceClass(HelloService.class);
		factory.setAddress("http://localhost:9081/cxf_hello/ws/service");
		// factory.setServiceName(SERVICE_NAME);
		HelloService service = (HelloService) factory.create();
		User u = new User();
		u.setId("1");
		List<String> addresses = new ArrayList<String>();
		addresses.add("address1");
		addresses.add("addresses2");
		u.setAddress(addresses);
		User getUser = service.sayHello1(u);
		System.out.println(getUser);
	}
}
